<?php

/***************************************************************
*  Copyright notice
*
*  (c) 2011 Florian Müller <it-admin@ifp-potsdam.co>, IFP
*  			
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/**
 * Testcase for class Tx_IfpCurriculum2_Domain_Model_Kurs.
 *
 * @version $Id$
 * @copyright Copyright belongs to the respective authors
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
 *
 * @package TYPO3
 * @subpackage IFP Curriculum 2
 * 
 * @author Florian Müller <it-admin@ifp-potsdam.co>
 */
class Tx_IfpCurriculum2_Domain_Model_KursTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
	/**
	 * @var Tx_IfpCurriculum2_Domain_Model_Kurs
	 */
	protected $fixture;

	public function setUp() {
		$this->fixture = new Tx_IfpCurriculum2_Domain_Model_Kurs();
	}

	public function tearDown() {
		unset($this->fixture);
	}
	
	
	/**
	 * @test
	 */
	public function getVersionReturnsInitialValueForInteger() { 
		$this->assertSame(
			0,
			$this->fixture->getVersion()
		);
	}

	/**
	 * @test
	 */
	public function setVersionForIntegerSetsVersion() { 
		$this->fixture->setVersion(12);

		$this->assertSame(
			12,
			$this->fixture->getVersion()
		);
	}
	
	/**
	 * @test
	 */
	public function getTitelReturnsInitialValueForString() { }

	/**
	 * @test
	 */
	public function setTitelForStringSetsTitel() { 
		$this->fixture->setTitel('Conceived at T3CON10');

		$this->assertSame(
			'Conceived at T3CON10',
			$this->fixture->getTitel()
		);
	}
	
	/**
	 * @test
	 */
	public function getUeReturnsInitialValueForInteger() { 
		$this->assertSame(
			0,
			$this->fixture->getUe()
		);
	}

	/**
	 * @test
	 */
	public function setUeForIntegerSetsUe() { 
		$this->fixture->setUe(12);

		$this->assertSame(
			12,
			$this->fixture->getUe()
		);
	}
	
	/**
	 * @test
	 */
	public function getBeschreibungReturnsInitialValueForString() { }

	/**
	 * @test
	 */
	public function setBeschreibungForStringSetsBeschreibung() { 
		$this->fixture->setBeschreibung('Conceived at T3CON10');

		$this->assertSame(
			'Conceived at T3CON10',
			$this->fixture->getBeschreibung()
		);
	}
	
	/**
	 * @test
	 */
	public function getLiteraturReturnsInitialValueForString() { }

	/**
	 * @test
	 */
	public function setLiteraturForStringSetsLiteratur() { 
		$this->fixture->setLiteratur('Conceived at T3CON10');

		$this->assertSame(
			'Conceived at T3CON10',
			$this->fixture->getLiteratur()
		);
	}
	
	/**
	 * @test
	 */
	public function getDozentReturnsInitialValueForTx_IfpCurriculum2_Domain_Model_Dozent() { }

	/**
	 * @test
	 */
	public function setDozentForTx_IfpCurriculum2_Domain_Model_DozentSetsDozent() { }
	
	/**
	 * @test
	 */
	public function getVeranstaltungenReturnsInitialValueForObjectStorageContainingTx_IfpCurriculum2_Domain_Model_Veranstaltung() { 
		$newObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
		$this->assertEquals(
			$newObjectStorage,
			$this->fixture->getVeranstaltungen()
		);
	}

	/**
	 * @test
	 */
	public function setVeranstaltungenForObjectStorageContainingTx_IfpCurriculum2_Domain_Model_VeranstaltungSetsVeranstaltungen() { 
		$veranstaltungen = new Tx_IfpCurriculum2_Domain_Model_Veranstaltung();
		$objectStorageHoldingExactlyOneVeranstaltungen = new Tx_Extbase_Persistence_ObjectStorage();
		$objectStorageHoldingExactlyOneVeranstaltungen->attach($veranstaltungen);
		$this->fixture->setVeranstaltungen($objectStorageHoldingExactlyOneVeranstaltungen);

		$this->assertSame(
			$objectStorageHoldingExactlyOneVeranstaltungen,
			$this->fixture->getVeranstaltungen()
		);
	}
	
	/**
	 * @test
	 */
	public function addVeranstaltungenToObjectStorageHoldingVeranstaltungen() {
		$veranstaltungen = new Tx_IfpCurriculum2_Domain_Model_Veranstaltung();
		$objectStorageHoldingExactlyOneVeranstaltungen = new Tx_Extbase_Persistence_ObjectStorage();
		$objectStorageHoldingExactlyOneVeranstaltungen->attach($veranstaltungen);
		$this->fixture->addVeranstaltungen($veranstaltungen);

		$this->assertEquals(
			$objectStorageHoldingExactlyOneVeranstaltungen,
			$this->fixture->getVeranstaltungen()
		);
	}

	/**
	 * @test
	 */
	public function removeVeranstaltungenFromObjectStorageHoldingVeranstaltungen() {
		$veranstaltungen = new Tx_IfpCurriculum2_Domain_Model_Veranstaltung();
		$localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
		$localObjectStorage->attach($veranstaltungen);
		$localObjectStorage->detach($veranstaltungen);
		$this->fixture->addVeranstaltungen($veranstaltungen);
		$this->fixture->removeVeranstaltungen($veranstaltungen);

		$this->assertEquals(
			$localObjectStorage,
			$this->fixture->getVeranstaltungen()
		);
	}
	
	/**
	 * @test
	 */
	public function getKursstamReturnsInitialValueForTx_IfpCurriculum2_Domain_Model_Kursstamm() { }

	/**
	 * @test
	 */
	public function setKursstamForTx_IfpCurriculum2_Domain_Model_KursstammSetsKursstam() { }
	
}
?>